<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

    </div>
</div>

<script>
    layui.use(['form', 'table','miniPage','element'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            miniPage = layui.miniPage;

        table.render({
            elem: '#currentTableId',
            url: 'http://localhost:8080/admin/diaries/allDiary',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {field: 'contentid', width: 120, title: '日记ID', sort: true},
                {field: 'content', width: 220, title: '日记内容'},
                {field: 'accountid', width: 120, title: '用户ID'},
                {field: 'name', width: 120, title: '用户名'},
                {field: 'tagid', width: 120, title: '标签ID'},
                {field: 'province', title: '省份', width: 120},
                {field: 'city', width: 120, title: '城市'},
                {field: 'distinct', width: 120, title: '区（县）'},
                {field: 'goodnum', width: 140, title: '点赞数', sort: true},
                {field: 'title', width: 160, title: '标题'},
                {field: 'diarydate', width: 170, title: "发布日期"}
            ]],
            page: true,
            skin: 'line'
        });

    });
</script>
